<?php
	include_once $_SERVER['DOCUMENT_ROOT'] . '/projet_mosquee/AMC/conf/conf.site.inc.php';
	// include_once $_SERVER['DOCUMENT_ROOT'] . '/inscriptions/conf/conf.site.inc.php';
	
	include_once INSCRIPTION_CLASS;
	
	$inscription = new inscription();
	$inscription->setValues ("",
							$_POST["inscription_nom"],
							$_POST["inscription_prenom"], 
							$_POST["inscription_email"], 
							$_POST["inscription_naissance"], 
							$_POST["inscription_tel"], 
							$_POST["inscription_adresse"], 
							$_POST["inscription_login"], 
							$_POST["inscription_password"],
							$_POST["inscription_verif"]);
							 
	$result = $inscription->insertInscription ();
	if ($result) {
		$aRetour = array();
		$aRetour["CODE_RETOUR"] = 1;
		$_SESSION["LOGIN"] = $_POST["inscription_login"];
		$_SESSION["ID_USER"] = $inscription->idUser;
	}
	else {
		$aRetour = array();
		$aRetour["CODE_RETOUR"] = 0;
	}
	echo json_encode($aRetour);
?>